<?php
$str = $_POST['str'];

$conn = new mysqli("localhost", "root", "", "simple_weibo");
$conn->query("set names 'utf8'");

$sql = "DELETE FROM weibo_user WHERE user_name='".$str."'";
$res = $conn->query($sql);

$sql1 = "DELETE FROM weibo_list WHERE author='".$str."'";
$res1 = $conn->query($sql1);

$sql2 = "DELETE FROM weibo_comment WHERE cm_author='".$str."'";
$res2 = $conn->query($sql2);

$sql3 = "DELETE FROM weibo_kidcomment WHERE kidcm_author='".$str."'";
$res3 = $conn->query($sql3);

$sql4 = "DELETE FROM weibo_relation WHERE user='".$str."' or fans='".$str."'";
$res4 = $conn->query($sql4);

$sql5 = "delete from weibo_sc where user = '".$str."'";
$res5 = $conn->query($sql5);

$sql6 = "delete from weibo_zan where user = '".$str."'";
$res6 = $conn->query($sql6);
if($res){
    echo "删除成功";
}else{
    echo "删除失败";
}
// echo "删除成功";